package com.wink_172.library.model

import android.Manifest
import android.os.Environment
import com.wink_172.library.utils.LogUtil
import org.xutils.x

object Constants {
    @JvmField
    var TEST_MODEL = false
    var SUPER_UER = true  //超级用户


    const val wink172_DOWN_URL = "http://106.52.115.24:8080/download/"
    const val APP_WEB_URL = wink172_DOWN_URL + "app/wink172-utils.apk" //apk升级地址
    const val BASE_URL = "https://www.baidu.com/" //测试环境域名   请注意多一个斜杠也不行
    const val TAG = "TAG"

    const val MAX_PICTURE_NUM9 = 9 //选择图片最大数量
    const val MAX_PICTURE_NUM6 = 6 //选择图片最大数量
    const val MAX_PICTURE_NUM3 = 3 //选择图片最大数量
    const val DOWNLOAD_FOLDER = "/Download/"

    /**
     * 腾讯cos
     */
    const val BUCKET_WINK172 = "fun4demo-1254407438" //存储桶BucketName-APPID
    const val BUCKET_TIANTIANTIAOWU = "tiantiantiaowu-1254951608" //存储桶BucketName-APPID
    const val TENCENT_OSS_PACKAGE_NAME_video_all = "video-all/" //短视频精选上传视频文件夹名称
    const val TENCENT_OSS_PACKAGE_NAME_temp_fd = "temp_fd/" //上传文件夹临时缓存目录名称（杂七杂八）
    const val TENCENT_BUCKET_OFFICE_URL = "https://fun4demo-1254407438.cos.ap-guangzhou.myqcloud.com/" //腾讯官方存储桶Bucket
    const val TENCENT_BUCKET_WINK_URL = "http://106.52.115.24:8080/download/" //个人服务器存储桶Bucket   速度会比较慢   一定是8080端口

    val cache_path = LogUtil.getCachePath(x.app())
    val savePath_Log =
        cache_path + "/wink-172-logs/"  //该目录不需要存储权限
    /**
     * 使用方法
     * **/
//    val callback=object:
//        com.wink_172.library.callback.ICallback {
//        override fun onSendEvent(event: Int, vararg args: Any?) {//这个callback用的非常巧妙     这里因为不能传递非Serialiazable,对象 所以需要精简代码
//            when (event) {
//            }
//        }
//    }

    /**
     * 使用方法2
     * */
//    object :
//        com.wink_172.library.callback.ICallback {
//        override fun onSendEvent(event: Int,vararg args: Any?) {//这个callback用的非常巧妙    //这里因为不能传递非Serialiazable,对象 所以需要精简代码
//
//        }
//    }
    @JvmField
    val savePath = Environment.getExternalStorageDirectory().absolutePath + DOWNLOAD_FOLDER
    val permissions = arrayOf(
//        Manifest.permission.CAMERA,
        Manifest.permission.WRITE_EXTERNAL_STORAGE,
        Manifest.permission.READ_EXTERNAL_STORAGE
    )

    /**
     * 列表样式枚举
     * 以下枚举都需要拷贝到引用的项目中  保持下标一致
     */
    enum class List_Enum {
        加载更多, 间距, 选择图片列表
    }



    /**
     *新版本事件枚举
     *旧版本不去改动
     */
    enum class EventEnum {
        //xutils相关
        网络请求成功,网络请求错误,网络请求取消,网络请求完成,下载进度更新,倒计时进行中,上传成功,
	上传失败,上传进度,列表滚动,输入框文字变动,返回,搜索,清空,拒绝,同意,单个确定按钮点击回调,倒计时结束,

        svga动效播完了
    }

    enum class SVGAEnum {
        解锁录像动效, full_power, 背景撒花弹窗页
    }


    /**
     * 常用参数名
     */

    const val CropPath = "/sdcard/SelectImage/"
    const val CropImageName = "crop.jpg" //裁剪缓存路径
    const val CropVideoName = "cropVideo.mp4" //视频缓存路径
    const val CropOutPutVideoName = "outputVideo.mp4" //视频缓存路径
    const val ThumbnailImageName = "Thumbnail.jpg" //视频图
    const val PARAM_APPID = "appid"
    const val PARAM_DEVICE = "device"
    const val PARAM_DATA1 = "data1"
    const val PARAM_DATA2 = "data2"
    const val PARAM_DATA3 = "data3"
    const val PARAM_DATA4 = "data4"
    const val PARAM_DATA5 = "data5"
    const val PARAM_DATA6 = "data6"
    const val PARAM_DATA7 = "data7"
    const val PARAM_DATA8 = "data8"
    const val PARAM_DATA9 = "data9"


    @JvmField
    var COUNT = 12
    const val max_num = "999999"

    /**
     * 动作事件类型
     */
    const val EVENT_01 = 1
    const val EVENT_02 = 2
    const val EVENT_03 = 3
    const val EVENT_04 = 4
    const val EVENT_05 = 5
    const val EVENT_06 = 6
    const val EVENT_07 = 7
    const val EVENT_08 = 8
    const val EVENT_09 = 9
    const val EVENT_10 = 10
    const val EVENT_11 = 11
    const val ACTIVITY_REQUEST_CODE3001 = 3001
    const val ACTIVITY_REQUEST_CODE3002 = 3002
    const val ACTIVITY_REQUEST_CODE3003 = 3003
    const val ACTIVITY_REQUEST_CODE3004 = 3004
    const val ACTIVITY_REQUEST_CODE3005 = 3005
    const val ACTIVITY_REQUEST_CODE3006 = 3006

    const val ACTIVITY_REQUEST_CODE_IMAGE_SEL = 30016 //图库
    const val ACTIVITY_REQUEST_CODE_IMAGE_PHOTO = 30017 //拍照
    const val ACTIVITY_REQUEST_CODE_PERMISSION = 30018 //权限申请
    const val ACTIVITY_REQUEST_CODE_VIDEO_SEL = 30019 //视频

    /**
     * sharePerfer 参数
     */
    const val LOGIN_INFO = "login_data"
    const val USER_INFO = "user_info"
    const val SEARCH_HISTORY = "search_history"

    @JvmField
    var PRINT_LOG = false //是否打印日志
}